<template>
  <div style="width:100%;height:600px;"></div>
</template>

<script>
import { y } from "../utils/data";
import echarts from "echarts";

export default {
  name: "zxt.vue",
  props: ["yAxis", "series", "text"],

  mounted() {
    const series = [
      {
        name: '2018',
        type: 'bar',
        data: this.series[0]
      },
      {
        name: '2019',
        type: 'bar',
        data: this.series[1]
      }
    ]
    console.log(this.$el);
    const myChart = echarts.init(this.$el);
    y(myChart, this.text, this.yAxis, series);
  }
};
</script>

<style scoped>
</style>